package com.chapter.sample.service.datasource;

import com.chapter.sample.entity.coupon.CouponEntity;
import com.chapter.sample.entity.member.MemberEntity;
import com.chapter.sample.service.CouponService;
import com.chapter.sample.service.MemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class DynamicDatasourceServiceImpl implements DynamicDatasourceService {
    @Autowired
    private CouponService couponService;

    @Autowired
    private MemberService memberService;

    @Override
    public void dynamicData() {
        List<MemberEntity> memberList = memberService.list();
        List<CouponEntity> couponList = couponService.list();
        log.info("member : {}", memberList);
        log.info("coupon : {}", couponList);
    }
}
